// service/interface.go
package service

import (
	"URLshortener/internal/model"
	"context"
)

type UrlService interface {
	// 创建短链接（含自动生成短码）
	CreateShortUrl(ctx context.Context, originalUrl string, expireHours int) (shortUrl string, err error)

	// 自定义短码创建
	CreateCustomShortUrl(ctx context.Context, originalUrl string, customCode string, expireHours int) error

	// 根据短码获取原始URL
	GetOriginalUrl(ctx context.Context, shortCode string) (originalUrl string, err error)

	// 获取链接详细信息
	GetUrlDetails(ctx context.Context, shortCode string) (*model.Url, error)

	// 删除短链接
	DeleteShortUrl(ctx context.Context, shortCode string) error
}
